using UnityEngine;
using UnityEngine.Tilemaps;

namespace GridExtend
{
    public class TileReplaceLauncher : MonoBehaviour
    {
        [SerializeField]
        private string targetTilemap;
        [SerializeField]
        private Tile newTile;

        public void Apply()
        {
            MyGrid myGrid = ActionController.GlobalGrid;
            Vector3Int cell = (Vector3Int)myGrid.WorldToCell(transform.position);
            MyTilemap myTilemap = myGrid.GetMyTilemap(targetTilemap);
            myTilemap[cell] = newTile;
        }
    }
}